﻿define(function (require) {
    var datacontext = require('modules/dataservice');

    return {
        customer: ko.observable(),
        orders: ko.observableArray(),
        activate: function (params) {
            var self = this;
            return datacontext.getOrdersByCustomer(params, self.orders);
        },
        canActivate: function (params) {
            var self = this;
            return datacontext.getCustomer(params, self.customer);
        }
    };
});